<style lang="scss" scoped>
	.plate{
		text{
			font-weight: bold;
			line-height: 100rpx;
			font-size: 34rpx;
		}
		image{
			float: left;
			width: 138rpx;
			height: 100rpx;
		}
	}

	.n1{
		color: $uni-color-primary;
	}
	.n2{
		color: $uni-color-warning;
	}
	.n3{
		font-weight: bold;
		color: $uni-color-success;
	}
	.news{
		/deep/ .uni-list-item {
			background-color: #F5F8FF;
		}
		/deep/ .uni-list-item__container{
			padding-left: 0;
			padding-right: 0;
		}
		.head{
			text{
				font-weight: bold;
				font-size: 36rpx;
				&::before{
					content: "";
					width: 4px;
					height: 80%;
					background-color: #3894F9;
					float: left;
					display: block;
					margin-top: 3%;
					margin-right: 10rpx;
				}
			}
			image{
				border-radius: 50%;
				padding:3rpx;
				border:1px solid #818181;
				width: 30rpx;
				margin-top: 4rpx;
			}
		}
		.list{
			background-color: #F5F8FF;
		}
	}
</style>
<template>
	<view class="auto-90 pb-3">
		<image src="https://gov-tool.js-cx.cn/static/home/img/banner.png" mode="widthFix" class="border-radius w-100b mt-3"/>
		<view class="d-flex between my-5">
			<navigator url="../infoQuery/index" class="plate border-radius box-shadow px-2 py-1" >
				<image src="https://gov-tool.js-cx.cn/static/home/img/plate1.png" class="mr-1"/>
				<text class="n1">信息咨询</text>
			</navigator>
			<navigator url="../policy/list" class="plate border-radius box-shadow px-2 py-1">
				<image src="https://gov-tool.js-cx.cn/static/home/img/plate2.png" class="mr-1"/>
				<text class="n2">政策解读</text>
			</navigator>
		</view>
		<view class="plate border-radius box-shadow px-2 py-1 text-center d-flex center my-5" @click="goQuestionnaire">
			<image src="https://gov-tool.js-cx.cn/static/home/img/plate3.png" class="mr-2"/>
			<text class="font-30 n3">参与问卷调查</text>
		</view>
		<view class="news pt-5 bg-fff px-2">
		<!-- 	<view class="head d-flex between">
				<image src="/static/img/news.png" mode="widthFix"></image>
				<text class="font-30" @click="goNews">更多&gt;&gt;&gt;</text>
			</view> -->
			<view class="head d-flex between">
				<text>政策公告</text>
				<image src="/static/icon/toRight.png" mode="widthFix" @click="goNews"></image>
			</view>
			<view class="list px-3 my-3">
				<uni-list :border="false">
					<uni-list-item style="padding: 0;" :to="'../policy/details?id='+val.id"  v-for="val in newsList" :key="val.id" :title="val.title" :ellipsis="2"></uni-list-item>
				</uni-list>
			</view>
		</view>
	</view>
</template>

<script>
	import {policyList} from "@api"
	export default {
		options: { styleIsolation: 'shared' },
		data() {
			return {
				newsList:[]
			}
		},
		methods:{
			goNews(){
				uni.navigateTo({url:'../policy/list'})
			},
			goQuestionnaire(){
				uni.navigateToMiniProgram({
					appId:"wxebadf544ddae62cb",
					path:"pages/survey/index?sid=9335470&hash=89a1",
				})
			}
		},
		onLoad() {
			policyList({sort:'desc',limit:5,date:0})
			.then(res=>{
				this.newsList=res.list
			})
		}
	}
</script>
